package com.example.yunJie.digitalSentry.control;

import com.example.yunJie.digitalSentry.entity.FaceDownEntity;
import com.example.yunJie.digitalSentry.service.FaceDownService;
import com.example.yunJie.digitalSentry.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
import java.util.List;

@RestController
@RequestMapping("/FaceDown")
public class FaceDownControl {

    @Autowired
    private FaceDownService faceDownService;

    @RequestMapping("/add")
    public R<?> insert(FaceDownEntity faceDownEntity){
        faceDownService.insert(faceDownEntity);
        return R.ok();
    }

    @RequestMapping("/update")
    public int update(FaceDownEntity faceDownEntity){
        return faceDownService.update(faceDownEntity);
    }

    @RequestMapping("/deleteById")
    public int  deleteById(int id){
        return faceDownService.deleteById(id);
    }

    @RequestMapping("/deleteIdList")
    public int  deleteIdList(List<Integer> id){
        return faceDownService.deleteIdList(id);
    }

    @RequestMapping("/findId")
    public FaceDownEntity  findId(Serializable id){
        return faceDownService.findId(id);
    }

    @RequestMapping("/findAll")
    public List<FaceDownEntity>  findAll(){
        return faceDownService.findAll();
    }

}
